package com.qrxl.enums;

import com.qrxl.common.exception.CustomException;

public enum EnumMenuTabFlag {

    NO(0, "当前页打开"),
    YES(1, "新窗口打开"),
    ;
    private Integer code;
    private String name;

    EnumMenuTabFlag(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static EnumMenuTabFlag getType(Integer code) {
        for (EnumMenuTabFlag anEnum : EnumMenuTabFlag.values()) {
            if (anEnum.getCode().equals(code)) {
                return anEnum;
            }
        }
        throw new CustomException("状态不合法!");
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
